/*     */ package com.lmpop.trade.ti_onlineservice;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ 
/*     */ public class Ti_onlineserviceInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_onlineserviceInfo()
/*     */   {
/*  15 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  24 */     Ti_onlineservice ti_onlineservice = new Ti_onlineservice();
/*  25 */     ti_onlineservice.setInfo_id(map.getString("info_id"));
/*  26 */     ti_onlineservice.setContact_name(map.getString("contact_name"));
/*  27 */     ti_onlineservice.setSer_type(map.getString("ser_type"));
/*  28 */     ti_onlineservice.setAccount(map.getString("account"));
/*  29 */     ti_onlineservice.setSort_no(map.getInt("sort_no"));
/*  30 */     ti_onlineservice.setIs_display(map.getString("is_display"));
/*  31 */     ti_onlineservice.setRemark(map.getString("remark"));
/*     */ 
/*  33 */     String result_code = "0";
/*     */     try {
/*  35 */       insert(dbmMgr, ti_onlineservice);
/*     */     } catch (ApplicationException e) {
/*  37 */       e.printStackTrace();
/*  38 */       result_code = "1";
/*     */     }
/*  40 */     map.setString("result_code", result_code);
/*  41 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_onlineservice ti_onlineservice)
/*     */     throws ApplicationException
/*     */   {
/*  50 */     dbmMgr.update("insertTi_onlineservice", ti_onlineservice);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  60 */     String pkid_string = map.getString("pkid");
/*  61 */     String result_code = "0";
/*     */     try {
/*  63 */       if (!pkid_string.equals("")) {
/*  64 */         String[] pkStr = pkid_string.split("\\|");
/*  65 */         for (int i = 0; i < pkStr.length; i++) {
/*  66 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  70 */       e.printStackTrace();
/*  71 */       result_code = "1";
/*     */     }
/*  73 */     map.setString("result_code", result_code);
/*  74 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  83 */     dbmMgr.update("deleteTi_onlineservice", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  92 */     Ti_onlineservice ti_onlineservice = new Ti_onlineservice();
/*  93 */     ti_onlineservice.setInfo_id(map.getString("info_id"));
/*  94 */     ti_onlineservice.setContact_name(map.getString("contact_name"));
/*  95 */     ti_onlineservice.setSer_type(map.getString("ser_type"));
/*  96 */     ti_onlineservice.setAccount(map.getString("account"));
/*  97 */     ti_onlineservice.setSort_no(map.getInt("sort_no"));
/*  98 */     ti_onlineservice.setIs_display(map.getString("is_display"));
/*  99 */     ti_onlineservice.setRemark(map.getString("remark"));
/*     */ 
/* 101 */     String result_code = "0";
/*     */     try {
/* 103 */       update(dbmMgr, ti_onlineservice);
/*     */     } catch (ApplicationException e) {
/* 105 */       e.printStackTrace();
/* 106 */       result_code = "1";
/*     */     }
/* 108 */     map.setString("result_code", result_code);
/* 109 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_onlineservice ti_onlineservice)
/*     */     throws ApplicationException
/*     */   {
/* 118 */     dbmMgr.update("updateTi_onlineservice", ti_onlineservice);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 128 */     Hashtable ti_onlineservice = (Hashtable)obj;
/* 129 */     if (start == 0)
/* 130 */       start = 0;
/*     */     else {
/* 132 */       start = (start - 1) * limit;
/*     */     }
/* 134 */     ti_onlineservice.put("start", Integer.valueOf(start));
/* 135 */     ti_onlineservice.put("limit", Integer.valueOf(limit));
/* 136 */     return this.queryList.getList("getListByTi_onlineservicePage", ti_onlineservice);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 147 */     Hashtable ti_onlineservice = (Hashtable)obj;
/* 148 */     List list = this.queryList.getList("getCountByObjTi_onlineservice", ti_onlineservice);
/* 149 */     int count = 0;
/* 150 */     if ((list != null) && (list.size() > 0)) {
/* 151 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 152 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 153 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 156 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 166 */     return this.queryList.getList("getTi_onlineserviceByPk", pk);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_onlineservice.Ti_onlineserviceInfo
 * JD-Core Version:    0.6.0
 */